<?php
/**
 * Created by PhpStorm.
 * User: 图图
 * Date: 2021-6-8
 * Time: 16:29
 */

namespace app\shoes\controller;
use app\web\controller\Express;
use think\Db;

/**
 * 下拉框数据集合控制器
 * @package app\index\controller
 */
class Select extends Auth
{
    public $noNeedLogin = [];


    /**
     * 获取所有项目
     */
    public function getProject(){
        $data = Db::name('qt_project')
            ->field('id,name,price')
            ->where(['store_id'=>$this->userInfo['store_id'],'status'=>'1'])
            ->select();
        $this->result('请求成功', $data, 200);
    }

    /**
     * 获取门店
     */
    public function get_store()
    {
        if ($this->request->isPost()) {
            $list = Db::name('qt_user_store')
                ->alias('us')
                ->leftJoin('qt_store s','s.id  = us.store_id')
                ->field('s.id,s.name')
                ->where(['us.user_id'=>$this->userInfo['id']])
                ->select();
            $this->result('获取成功', $list);
        } else {
            $this->result('请求错误', '', 204);
        }
    }










}
